import Vue from 'vue'
import VueRouter from 'vue-router'
import Register from '@/views/Register'
import Login from '@/views/Login'
import Home from '@/views/Home'
import view1 from '@/views/view1'
import view2 from '@/views/view2'
import view3 from '@/views/view3'
import view4 from '@/views/view4'
import view5 from '@/views/view5'

Vue.use(VueRouter)

const routes = [
  {
    path: '/register',
    component: Register
  },
  {
    path: '/login',
    component: Login
  },
  {
    path: '/home',
    component: Home,
    children: [
      {
        path: '',
        component: view1
      },
      {
        path: '/view2',
        component: view2
      },
      {
        path: '/view3',
        component: view3
      },
      {
        path: '/view4',
        component: view4
      },
      {
        path: '/view5',
        component: view5
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  routes
})

export default router
